home *** CD-ROM | disk | FTP | other *** search
/ PsL Monthly 1993 December / PSL Monthly Shareware CD-ROM (December 1993).iso / prgmming / dos / pascal / tpref.exe / TPR7.TXT < prev    next >
Text File  |  1992-10-19  |  47KB  |  1,298 lines

  1.                                    Chapter 7
  2.                                     of the
  3.                             Turbo Pascal Reference
  4.  
  5.                           The Turbo Vision Reference
  6.                                   (continued)
  7.  
  8. This chapter is part of the Turbo Pascal Reference electronic freeware book (C)
  9. Copyright 1992 by Ed Mitchell.  This freeware book contains supplementary
  10. material to Borland Pascal Developer's Guide, published by Que Corporation,
  11. 1992.  However, Que Corporation has no affiliation with nor responsibility for
  12. the content of this free book.  Please see Chapter 1 of the Turbo Pascal
  13. Reference for important information about your right to distribute and use this
  14. material freely.  If you find this material of use, I would appreciate your
  15. purchase of one my books, such as the Borland Pascal Developer's Guide or
  16. Secrets of the Borland C++ Masters, Sams Books, 1992.  Thank you.
  17.  
  18. For additional information on using Turbo Vision, including a detailed
  19. tutorial, please see Chapters 11 through 16 of the Borland Pascal Developer's
  20. Guide.
  21.  
  22.  
  23. HistoryAdd procedure
  24. ------------------------------------------------------------
  25. Declaration:  
  26.      procedure HistoryAdd
  27.      ( Id: Byte; var Str: String);
  28.  
  29. Unit:  HistList
  30.  
  31. Purpose:
  32.      This is an internal routine used by the THistory and related objects to
  33.      add a string Str to the history list identified by the Id number.
  34.  
  35.  
  36. HistoryBlock variable
  37. ------------------------------------------------------------
  38. Declaration:  
  39.      HistoryBlock: Pointer = nil;
  40.  
  41. Unit:  HistList
  42.  
  43. Purpose:
  44.      The THistory object allocates a block of memory from the heap in order to
  45.      store the history list.  HistoryBlock is set to point to this memory
  46.      block.
  47.  
  48.  
  49. HistoryCount function
  50. ------------------------------------------------------------
  51. Declaration:  
  52.      function HistoryCount(Id: Byte): Word;
  53.  
  54. Unit:  HistList
  55.  
  56. Purpose:  
  57.      The THistory history list system, and the associated history list memory
  58.      manager (See HistoryAdd, HistoryBlock, HistorySize, HistoryStr,
  59.      HistoryUsed) can manage multiple memory history lists.  The HistoryCount
  60.      function calculates and returns the number of items stored in the history
  61.      list selected by the Id value.
  62.  
  63.  
  64. HistorySize variable
  65. ------------------------------------------------------------
  66. Declaration: 
  67.      HistorySize: Word = 1024;
  68.  
  69. Unit:
  70.      HistList
  71.  
  72. Purpose:  
  73.      At program initialization, TApplication.Init calls the InitHistory
  74.      procedure to allocate history list memory space.  The default allocation
  75.      is determined by the value stored in HistorySize.  To change this value,
  76.      set HistorySize to a new size, specified in bytes, before calling
  77.      TApplication.Init.
  78.  
  79.  
  80. HistoryStr function
  81. ------------------------------------------------------------
  82. Declaration:  
  83.      function HistoryStr(Id: Byte; Index: Integer): String;
  84.  
  85. Unit:  HistList
  86.  
  87. Purpose:  
  88.      Looks into the history list specified by Id, and returns the contents of
  89.      the Index'th string in the list.
  90.  
  91.  
  92. HistoryUsed variable
  93. ------------------------------------------------------------
  94. Declaration: 
  95.      HistoryUsed: Word = 0;
  96.  
  97. Unit:  HistList
  98.  
  99. Purpose:  
  100.      This is an internal value used by the history list routines.
  101.  
  102.  
  103. InitHistory procedure
  104. ------------------------------------------------------------
  105. Declaration: 
  106.      procedure InitHistory;
  107.  
  108. Unit:  HistList
  109.  
  110. Purpose:
  111.      TApplication.Init calls this routine to initialize the history list
  112.      management system.  Also see HistorySize and THistory.
  113.  
  114.  
  115. InputBox function      
  116. ------------------------------------------------------------ 
  117. Declaration:
  118.                function InputBox (Title : String;
  119.                                  ALabel : String;
  120.                                  var S : String;
  121.                                  Limit : Byte ) : Word;
  122.  
  123. Unit:          MsgBox, source code in \TP\TVDEMOS\MSGBOX.PAS
  124.  
  125. Purpose:
  126.      InputBox is not described in the Borland documentation but is contained in
  127. the file MSGBOX.PAS (and MSGBOX.TPU) contained in the \TP\TVDEMOS directory (TP
  128. 6.0).
  129.      InputBox displays a simple dialog with a single label and input field,
  130. plus Okay and Cancel buttons.  The Title parameter becomes the dialog box
  131. title, and the input field is given ALabel as a prompt line.  The input field
  132. is set to Limit bytes in length.  InputBox returns eithe cmOkay or cmCancel. 
  133. See Listing DMSGBOX3.PAS for an example of using the message box.
  134.    1  { DMSGBOX3.PAS
  135.    2    Demonstrates use of InputBox
  136.    3  }
  137.    4  procedure TShell.DemoInputBox;
  138.    5  var
  139.    6    Control : Word;
  140.    7  begin
  141.    8    Control := InputBox('The Title', 'Enter some text:',
  142.                FileName, 30);
  143.    9  end; { TShell.DemoInputBox }
  144.  
  145. See:  MessageBox, InputBoxRect, MessageBoxRect for related functions.
  146.  
  147.  
  148.  
  149. InputBoxRect function
  150. ------------------------------------------------------------ 
  151. Declaration:
  152.                function InputBox (var Bounds : TRect;
  153.                                  Title : String;
  154.                                  ALabel : String;
  155.                                  var S : String;
  156.                                  Limit : Byte ) : Word;
  157.  
  158. Unit:          MsgBox, source code in \TP\TVDEMOS\MSGBOX.PAS
  159.  
  160. Purpose:
  161.      InputBoxRect is not described in the Borland documentation but is
  162. contained in the file MSGBOX.PAS (and MSGBOX.TPU) contained in the \TP\TVDEMOS
  163. directory (TP 6.0).
  164.      InputBoxRect is identical to InputBox except that you can specify a
  165. bounding rectangle in order to position and size the input box to specific
  166. coordinates.  See also MessageBoxRect.
  167.  
  168. See:  InputBox, MessageBox, MessageBoxRect
  169.  
  170.  
  171. InitEvents procedure
  172. ------------------------------------------------------------
  173. Declaration:  
  174.      procedure InitEvents;
  175.  
  176. Unit: Drivers;
  177.  
  178. Purpose:
  179.      This internal procedure initializes Turbo Vision's event manager, and
  180.      initializes and displays the mouse, if installed.   InitEvents is
  181.      automatically called by TApplication.Init, and is terminated by calling
  182.      its corresponding DoneEvent procedure.
  183.  
  184.  
  185. InitMemory procedure
  186. ------------------------------------------------------------
  187. Declaration: 
  188.      procedure InitMemory;
  189.  
  190. Unit:  Memory
  191.  
  192. Purpose:
  193.      This internal procedure initialize's Turbo Vision's memory management
  194.      system and is automatically called by TApplication.Init.  InitMemory is
  195.      terminated by calling its corresponding DoneMemory.
  196.  
  197.  
  198. InitSysError procedure
  199. ------------------------------------------------------------
  200. Declaration:  
  201.      procedure InitSysError;
  202.  
  203. Unit:  Drivers
  204.  
  205. Purpose:
  206.      This internal procedure, called by TApplication.Init, initializes system
  207.      error trapping by redirecting the interrupt vectors 09H, 1BH, 21H, 23H,
  208.      and 24H and clearing DOS's Ctrl-Break state.  System error trapping is
  209.      terminated by calling the corresponding DoneSysError routine.
  210.  
  211.  
  212. InitVideo procedure
  213. ------------------------------------------------------------
  214. Declaration:  
  215.      procedure InitVideo;
  216.  
  217. Unit: Drivers
  218.  
  219. Purpose:
  220.      This internal procedure, called by TApplication.Init, initialize's Turbo
  221.      Vision's video display manager and switches the display to the mode
  222.      specified in the ScreenMode variable.  InitVideo initializes the variables
  223.      ScreenWidth, ScreenHeight, HiResScreen, CheckSnow, ScreenBuffer and
  224.      CursorLines.
  225.  
  226.  
  227. kbXXXX constants
  228. ------------------------------------------------------------
  229. Keyboard constants
  230.      The kbXXXX constants are divided into two groups:  a small group for
  231. detecting keyboard shift states, and a large group as equates for the
  232. non-standard keystrokes such as function and Alt keys.
  233.  
  234. Keyboard Shift State constants
  235. Constant       Value    Usage
  236.  
  237. kbRightShift   $0001   Bit set if the right shift key down
  238. kbLeftShift    $0002   Bit set if the left shift key down
  239. kbCtrlShift    $0004   Bit set if the Ctrl key is down
  240. kbAltShift     $0008   Bit set if the Alt key is down
  241. kbScrollState  $0010   B